import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule } from '@angular/http';
import { IonicStorageModule } from '@ionic/storage';
import { FileTransfer } from '@ionic-native/file-transfer';
import { Camera } from '@ionic-native/camera';
import { ImagePicker } from '@ionic-native/image-picker';
import { Keyboard } from '@ionic-native/keyboard';
import { File } from '@ionic-native/file';
import { FileOpener } from '@ionic-native/file-opener';
import { AppVersion } from '@ionic-native/app-version';
import { JPushService, IonJPushModule } from 'ionic2-jpush';
import { MyJPushService } from '../providers/plugin-service/jPush-service';
import { MyApp } from './app.component';
import { config } from '../global/config';
import { Api } from '../providers/api-service';
import { ButtonService } from '../providers/button.service';
import { UrlService } from '../providers/url-service';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { NativeAudio } from "@ionic-native/native-audio";
import { NoticeService } from '../providers/notice-service';
import { MultiPickerModule } from 'ion-multi-picker';
// import { TestPage } from '../pages/test/test';
import { ComponentsModule } from '../components/components.module';
import { Device } from '@ionic-native/device';
//Pip
import { PipesModule } from '../pipes/pipes.module';
import { QQSDK } from '@ionic-native/qqsdk';
import { QRScanner } from '@ionic-native/qr-scanner';
// //页面
import { AboutPage } from '../pages/about/about';
import { AddGroupUserCirclePage } from '../pages/add-group-user-circle/add-group-user-circle';
import { AddfriendsPage } from '../pages/addfriends/addfriends';
import { WelcomePage } from '../pages/welcome/welcome';
import { AgreementPage } from '../pages/user/user-agreement/agreement';
import { AllTargetPage } from '../pages/all-target/all-target';
import { BasicDataPage } from '../pages/basic-data/basic-data';

// 挑战详情
import { ChallengeDetialOneEndPage } from '../pages/challenge-detial/challenge-detial-one-end/challenge-detial-one-end';
import { ChallengeDetialOneFaqiPage } from '../pages/challenge-detial/challenge-detial-one-faqi/challenge-detial-one-faqi';
import { ChallengeDetialOneStartPage } from '../pages/challenge-detial/challenge-detial-one-start/challenge-detial-one-start';
import { ChallengeDetialThreeStartPage } from '../pages/challenge-detial/challenge-detial-three-start/challenge-detial-three-start';
import { ChallengeDetialTwoStartPage } from '../pages/challenge-detial/challenge-detial-two-start/challenge-detial-two-start';

import { ChangeResultPage } from '../pages/change-result/change-result';
import { ChangeUserlistPage } from '../pages/change-userlist/change-userlist';
import { ChatOnePage } from '../pages/chat-one/chat-one';
import { ChengyuanPage } from '../pages/chengyuan/chengyuan';
import { ComeOnPage } from '../pages/come-on/come-on';
import { ContactPage } from '../pages/contact/contact';
import { DashangPage } from '../pages/dashang/dashang';
import { DetialPage } from '../pages/detial/detial';
import { EditChallengePage } from '../pages/edit-challenge/edit-challenge';
import { HomePage } from '../pages/home/home';
import { HomeTargetPage } from '../pages/home/home-target/home-target';
import { InvitationFriendHomePage } from '../pages/my-add-issuance/invitation-friend-home/invitation-friend-home';
import { LabelHomePage } from '../pages/label-home/label-home';
import { LoginPage } from '../pages/login/login';
import { MyChallengePage } from '../pages/home/my-challenge/my-challenge';
import { MyComingbattlePage } from '../pages/my-comingbattle/my-comingbattle';
import { MyRankingPage } from '../pages/home/my-ranking/my-ranking';
import { MyAddIssuancePage } from '../pages/my-add-issuance/my-add-issuance';
import { NewChallengePage } from '../pages/my-add-issuance/new-challenge/new-challenge';
import { NewTargetCailiPage } from '../pages/new-target-caili/new-target-caili';
import { NewTargetInfoPage } from '../pages/new-target-info/new-target-info';
import { NewTargetNaoliPage } from '../pages/new-target-naoli/new-target-naoli';
import { NewTargetTiliPage } from '../pages/new-target-tili/new-target-tili';
import { NewTargetXinliPage } from '../pages/new-target-xinli/new-target-xinli';
import { PasswordResetPage } from '../pages/login/password-reset/password-reset';
import { PayCenterPage } from '../pages/pay-center/pay-center';
import { PhoneBindPage } from '../pages/login/phone-bind/phone-bind';
import { PublishYueliaoPage } from '../pages/publish-yueliao/publish-yueliao';
import { PublishingDynamicsPage } from '../pages/publishing-dynamics/publishing-dynamics';
import { PublishingDynamicsNumPage } from '../pages/publishing-dynamics-num/publishing-dynamics-num';
import { RankingPage } from '../pages/ranking/ranking';
import { RegisterPage } from '../pages/login/register/register';
import { SearchPage } from '../pages/search/search';
import { SelectCanyvPersonPage } from '../pages/select-canyv-person/select-canyv-person';
import { SelectDuizhanPersonPage } from '../pages/select-duizhan-person/select-duizhan-person';
import { TabsPage } from '../pages/tabs/tabs';
import { TargetDetialPage } from '../pages/home/target-detial/target-detial';
import { ThreePage } from '../pages/three/three';
import { TotalWarPage } from '../pages/total-war/total-war';
import { TuijianChangePage } from '../pages/tuijian-change/tuijian-change';
import { UserPage } from '../pages/user/user';
import { UserSettingPage } from '../pages/user/user-setting/setting';
import { UserDetialChallengePage } from '../pages/user/user-detial-challenge/user-detial-challenge';
import { UserMycollectPage } from '../pages/user/user-mycollect/user-mycollect';
import { UserWodekefuPage } from '../pages/user/user-wodekefu/user-wodekefu';
import { UserYueliaoPage } from '../pages/user/user-yueliao/user-yueliao';
import { UserRqPage } from '../pages/user/user-rq/user-rq';
import { UserMywalletPage } from '../pages/user/user-mywallet/user-mywallet';

import { UserLichanPage } from './../pages/user/user-lichan/user-lichan';
import { WenzhangDetailPage } from '../pages/about/wenzhang-detail/wenzhang-detail';
import { WenzhangPage } from '../pages/wenzhang/wenzhang';
import { WenzhangListPage } from '../pages/about/wenzhang-list/wenzhang-list';
import { WhoCanSeePage } from '../pages/who-can-see/who-can-see';
import { YueliaoPage } from '../pages/yueliao/yueliao';
import { GroupDetailPage } from '../pages/group-detail/group-detail';
import { SettingAccountPage } from '../pages/user/user-setting/account/setting-account';
import { SettingFankuiPage } from '../pages/user/user-setting/fankui/setting-fankui';

import { WalletZhanDoumxPage } from '../pages/user/user-mywallet/wallet-zhandoumx/wallet-zhandoumx';
import { WalletYuemxPage } from '../pages/user/user-mywallet/wallet-yuemx/wallet-yuemx';
import { WalletYaoQingMxPage } from '../pages/user/user-mywallet/wallet-yaoqingmx/wallet-yaoqingmx';

import { SettingAboutPage } from '../pages/user/user-setting/about/setting-about';
import { TestPage } from '../pages/test/test';
import { HuatiDetialPage } from '../pages/about/huati-detial/huati-detial';
import { ChallengeGuanfangPage } from '../pages/about/challenge-guanfang/challenge-guanfang';
import { MessagePage } from '../pages/message/message';
import { PageRewardPage } from '../pages/page-reward/page-reward';
import { ImgService } from '../providers/camera-service';
import { HuodongxiangqingPage } from '../pages/huodongxiangqing/huodongxiangqing';
import { HuodongListPage } from '../pages/about/huodong-list/huodong-list';
import { HuatiListPage } from '../pages/about/huati-list/huati-list';
import { PublishChallengeHtGuanfangPage } from '../pages/publish-challenge-ht-guanfang/publish-challenge-ht-guanfang';
import { HuifuDetialPage } from '../pages/about/huifu-detial/huifu-detial';
import { ClockPage } from '../pages/my-add-issuance/clock/clock';
import { DynamicPage } from '../pages/my-add-issuance/dynamic/dynamic';
import { PersonaldataPage } from '../pages/user/personaldata/personaldata';
import { LoginPluginProvider } from '../providers/login-plugin/login-plugin';
import { SharePluginProvider } from '../providers/share-plugin/share-plugin';
import { UserSannerPage } from '../pages/user/user-sanner/user-sanner';

// --haokur
import { HaokurPages } from './modules/haokur.modules'
import { Social } from '../providers/social.service';

// --wythetan
import { WythetanPages, WythetanProviders } from './modules/wythetan.modules'

// --video插件
import { VgCoreModule } from 'videogular2/core';
import { VgControlsModule } from 'videogular2/controls';
import { VgOverlayPlayModule } from 'videogular2/overlay-play';
import { VgBufferingModule } from 'videogular2/buffering';

const Pages = [
	WelcomePage,
	MyApp,
	AboutPage,
	AddGroupUserCirclePage,
	AddfriendsPage,
	AgreementPage,
	AllTargetPage,
	BasicDataPage,
	ChallengeDetialOneEndPage,
	ChallengeDetialOneFaqiPage,
	ChallengeDetialOneStartPage,
	ChallengeDetialThreeStartPage,
	ChallengeDetialTwoStartPage,
	ChallengeGuanfangPage,
	ChangeResultPage,
	ChangeUserlistPage,
	ChatOnePage,
	ChengyuanPage,
	ComeOnPage,
	ContactPage,
	ClockPage,
	DashangPage,
	DetialPage,
	DynamicPage,
	EditChallengePage,
	GroupDetailPage,
	HomePage,
	HomeTargetPage,
	HuatiDetialPage,
	HuodongxiangqingPage,
	HuodongListPage,
	HuatiListPage,
	HuifuDetialPage,
	InvitationFriendHomePage,
	LabelHomePage,
	LoginPage,
	MyChallengePage,
	MyComingbattlePage,
	MyRankingPage,
	MessagePage,
	MyAddIssuancePage,
	NewChallengePage,
	NewTargetCailiPage,
	NewTargetInfoPage,
	NewTargetNaoliPage,
	NewTargetTiliPage,
	NewTargetXinliPage,
	PasswordResetPage,
	PayCenterPage,
	PhoneBindPage,
	PublishYueliaoPage,
	PublishingDynamicsPage,
	PublishingDynamicsNumPage,
	PageRewardPage,
	PublishChallengeHtGuanfangPage,
	PersonaldataPage,
	RankingPage,
	RegisterPage,
	SearchPage,
	SelectCanyvPersonPage,
	SelectDuizhanPersonPage,
	UserSettingPage,
	TabsPage,
	TargetDetialPage,
	ThreePage,
	TotalWarPage,
	TuijianChangePage,
	UserPage,
	UserDetialChallengePage,
	UserMycollectPage,
	UserYueliaoPage,
	UserMywalletPage,
	UserWodekefuPage,
	UserRqPage,
	UserLichanPage,
	UserSannerPage,
	WenzhangPage,
	WenzhangDetailPage,
	WenzhangListPage,
	WhoCanSeePage,
	WalletZhanDoumxPage,
	WalletYuemxPage,
	WalletYaoQingMxPage,
	YueliaoPage,
	SettingAboutPage,
	SettingFankuiPage,
	SettingAccountPage,
	TestPage,
	...HaokurPages,
	...WythetanPages,
]

@NgModule({
	declarations: [
		...Pages,
	],
	imports: [
		BrowserModule,
		HttpModule,
		MultiPickerModule,
		IonJPushModule,
		PipesModule,
		IonicModule.forRoot(MyApp, config),
		ComponentsModule,
		IonicStorageModule.forRoot(),  //页面懒加载需要注释掉
		
		VgCoreModule,
		VgControlsModule,
		VgOverlayPlayModule,
		VgBufferingModule,
	],
	bootstrap: [IonicApp],
	entryComponents: [
		...Pages,
	],
	providers: [
		ImgService,
		StatusBar,
		SplashScreen,
		AppVersion,
		File,
		NativeAudio,
		Device,
		FileOpener,
		FileTransfer,
		Keyboard,
		Camera,
		ImagePicker,
		Api,
		ButtonService,
		UrlService,
		JPushService,
		MyJPushService,
		NoticeService,
		{
			provide: ErrorHandler,
			useClass: IonicErrorHandler
		},
		QQSDK,
		QRScanner,
		LoginPluginProvider,
		SharePluginProvider,
		Social,
		...WythetanProviders,
	]
})
export class AppModule { }
